package ambika.threads;




public class Threads extends Thread {

	

	  Thread threads  [] = new Thread[10];
		private volatile int threadId;
		//Thread threads[];
	

	public Threads(Thread[] threads){
		this.threads = threads;
	
	}
	
	public Threads(int threadId){
		this.threadId = threadId;
	}
	

	public void run(){
		for(int i = 0;i < threads.length; i ++){
			System.out.println("Running thread number "+i+" with id "+threadId);

			 if(i == 7){
				 try {
					threads[i].sleep(1000);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			 }
		}
	}
	

}
